#include "Misc_t.hh"
#include <vector>
#include <QtTest/QtTest>
#include "Allocator.hpp"

using namespace std;
using namespace TC;


namespace {

  struct A 
  {
    char c;
    int i;
    double d;
  };

}


void Misc_t::allocator_tests()
{
  vector<int, Allocator<int> > v1(30);
  vector<A, Allocator<A> > v2(5);

  QVERIFY(v1.size()==30);
  QVERIFY(v2.size()==5);

  vector<int> v3(10);
  // This should fail to compile: v1 = v3;

  vector<int, Allocator<int> > v4;
  v1 = v4;
  QVERIFY(v1.empty());
}
